#include "tcpserver.hpp"
#include<memory>

using namespace std;
using namespace server;//自己创建的命名空间

static void Usage(string proc)
{
    cout << "\nUsage:\n\t" << proc << " local_prot\n\n";
}

//
// ./tcpserver local_prot//自己的端口号
int main(int agrc, char* argv[])
{
    if (agrc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);

    unique_ptr<TcpServer> tsvr(new TcpServer());
    tsvr->initserver();
    tsvr->start();

    return 0;
}